package com.lry.pda;

public class Register {

    private String[] names = new String[100];
    private int idx = 0;

    public Register(){
        for(int i=0;i<names.length;i++){
            names[i] = "t"+i;
        }
    }

    public String getName(){
        return names[idx++];
    }


    public void free(String name){
        idx--;
        if(idx>=0){
            names[idx] = name;
        }
    }
}
